class fragments::node (
      String $node_install_dir,
      String $mainuser = lookup('mainuser')
) {
      file { '/etc/profile.d/node.sh':
           ensure => present,
           owner => 'root',
           content => template('fragments/node.sh.erb'),
      }
      file { "/home/${mainuser}/.npmrc":
           ensure => present,
           owner => "$mainuser",
           content => 'registry=https://registry.npm.taobao.org'
      }

}